package com.ruoyi.blog.service.impl;

import com.ruoyi.blog.dao.MessageDao;
import com.ruoyi.blog.pojo.Message;
import com.ruoyi.blog.service.MessageService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageServiceImpl extends ServiceImpl<MessageDao, Message> implements MessageService {

    @Override
    public List<Message> findAll() {
        QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
        queryWrapper.orderByDesc("create_date");
        return baseMapper.selectList(queryWrapper);
    }
}
